import Home from '../pages/home'
import Ui from '../pages/ui'
import JButton from '../pages/ui/button'
import Modal from '../pages/ui/modals'
import JLoading from '../pages/ui/loading'
import NotFound from '../pages/NotFound'
import Notification from '../pages/ui/notification'
import Message from '../pages/ui/message'
import Tab from '../pages/ui/tabs'
import Gallery from '../pages/ui/gallery'
import JCarousel from '../pages/ui/carousel'
import JForm from '../pages/form'
import Login from '../pages/form/login'
import Register from '../pages/form/register'
import Tables from '../pages/table'
import Basic from '../pages/table/basic'
import High from '../pages/table/high'
import RichText from '../pages/rich'
import City from '../pages/city'
import Order from '../pages/order'
import Detail from '../pages/order/detail'
import User from '../pages/user'
import UserDetail from '../pages/user/detail'
import BikeMap from '../pages/map'
import Charts from '../pages/charts'
import Bar from '../pages/charts/bar'
import Pie from '../pages/charts/pie'
import Line from '../pages/charts/line'
import Permission from '../pages/permission'
const routes = [
  { 
    path: '/',
    element: <Home />
  },
  {
    path: '/home',
    element: <Home />
  },
  // ui
  {
    path: '/ui',
    element: <Ui />,
    // 子路由
    children:[
      {
        path: 'buttons',
        element: <JButton />
      },
      {
        path: 'modals',
        element: <Modal />
      },
      {
        path: 'loadings',
        element: <JLoading />
      },
      {
        path: 'notification',
        element: <Notification />
      },
      {
        path: 'messages',
        element: <Message />
      },
      {
        path: 'tabs',
        element: <Tab />
      },
      {
        path: 'gallery',
        element: <Gallery />
      },
      {
        path: 'carousel',
        element: <JCarousel />
      }
    ]
  },
  {
    path: '/form',
    element: <JForm />,
    children: [
      {
        path: 'login',
        element: <Login />
      },
      {
        path: 'reg',
        element: <Register />
      }
    ]
  },
  {
    path: '/table',
    element: <Tables />,
    children: [
      {
        path: 'basic',
        element: <Basic />
      },
      {
        path: 'high',
        element: <High />
      }
    ]
  },
  // 富文本
  {
    path: '/rich',
    element: <RichText />
  },
  {
    path: '/city',
    element: <City />
  },
  {
    path: '/detail',
    element: <Order />
  },
  {
    path: '/detail/:id',
    element: <Detail />
  },
  {
    path: '/user',
    element: <User />
  },
  {
    path:'/user/detail/:id',
    element:<UserDetail/>
  },
  {
    path:'/bikeMap',
    element:<BikeMap/>
  },
  {
    path: 'charts',
    element: <Charts />,
    children: [
      {
        path: 'bar',
        element: <Bar />
      },
      {
        path: 'pie',
        element: <Pie />
      },
      {
        path: 'line',
        element: <Line />
      }
    ]
  },
  {
    path: '/permission',
    element: <Permission />
  },
  {
    path: '/*',
    element: <NotFound />
  }
]

export default routes

/*
子路由不带 / 以相对路径进行访问
ui/buttons

子路由带 / 以绝对路径进行访问，加上 / 不会拼接上父级路由的path路径

*/
